<div class="model_actions_toolbar">
    <?php $this->widget('backend.components.ModelActions'); ?>
</div>

<?php
echo CHtml::beginForm(array('cases/batchProcess'), 'post', array(
'onSubmit' => "return fnOnSubmitConfirm('" . CHtml::encode(Yii::t('jsmsg', 'confirm_tips_batch_process')) . '\',\'' . Yii::t('jsmsg', 'unselect_tips') . "');"
));
?>
<table border="0" width="100%" cellpadding="0" cellspacing="0" class="datas_grid">
    <thead>
        <tr>
            <th><input type="checkbox" id="checkallboxs" onclick="$('input[name=\'select[]\']').attr('checked', this.checked);" /></th>
            <th><?php echo $sort->link('order_pos'); ?></th>
            <th><?php echo $sort->link('name'); ?></th>
            <th><?php echo $sort->link('url'); ?></th>
            <th><?php echo $sort->link('icon_saved_path'); ?></th>
            <th><?php echo $sort->link('is_recommend'); ?></th>
            <th><?php echo $sort->link('is_picking'); ?></th>
            <th><?php echo $sort->link('status'); ?></th>
            <th><?php echo $sort->link('clicks_count'); ?></th>
            <th><?php echo $sort->link('created'); ?></th>
            <th><?php echo $sort->link('updated'); ?></th>
            <th>&nbsp;</th>
        </tr>
    </thead>
    <tfoot>
        <tr>
            <td colspan="3">
                <?php
                echo CHtml::hiddenField('current_node', $current_node);
                echo CHtml::dropDownList('action_list', '', ActionList::getActionList());
                echo CHtml::submitButton(Yii::t('common', 'ok'), array('class' => 'btn'));
                ?>
            </td>
            <td colspan="9">
                <?php $this->widget('CLinkPager', array('pages' => $pages)); ?>
            </td>
        </tr>
    </tfoot>
    <tbody>
        <?php foreach($models as $n => $model): ?>
        <tr class="<?php echo ($n % 2) ? 'even' : 'odd'; ?>">
            <td class="sn_and_checkbox">
                <input type="checkbox" name="select[]" value="<?php echo $model->id; ?>">
                    <?php echo sprintf("%02d", ++$n + $pages->getCurrentPage() * $pages->getPagesize()); ?>
            </td>
            <td><input type="text" name="order_pos[<?php echo $model->id; ?>]" value="<?php echo $model->order_pos; ?>" class="numerical" /></td>
            <td>
                <span class="id">#<?php echo $model->id; ?></span>
                <?php echo $model->nameHtmlFormat; ?>
            </td>
            <td><?php echo $model->url; ?></td>
            <td><?php echo $model->clicks_count; ?></td>
            <td><?php echo $model->isRecommendAjaxLink; ?></td>
            <td><?php echo $model->isPickingAjaxLink; ?></td>
            <td><?php echo $model->statusAjaxLink; ?></td>
            <td><?php echo $model->clicks_count; ?></td>
            <td><?php echo date('Y-m-d', $model->created); ?></td>
            <td><?php echo $model->updatedFormatted; ?></td>
            <td class="action">
                <?php
                echo CHtml::link(CHtml::image(Yii::app()->baseUrl . '/assets/backend/images/btn_edit.png'),
                    array('update', 'id' => $model->id, 'node' => $model->node_id)
                );
                ?>
            </td>
        </tr>
        <?php endforeach; ?>
    </tbody>
</table>
<?php echo CHtml::endForm(); ?>
